package com.haojin.spring.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

/**
 * @author .29.
 * @create 2023-03-01 11:34
 */
//配置类
@Configuration    //声明为Spring配置类
@ComponentScan("com.haojin.spring.config")  //设置需要扫描的包
public class ValidationConfig {

    @Bean    //返回值放入ioc容器
    public LocalValidatorFactoryBean validator() {
        return new LocalValidatorFactoryBean();
    }
}